/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "eme_fisico_atencion")
@NamedQueries({
    @NamedQuery(name = "EmeFisicoAtencion.findAll", query = "SELECT e FROM EmeFisicoAtencion e")})
public class EmeFisicoAtencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "efa_id")
    private Integer efaId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "efa_tipo")
    private int efaTipo;
    @Size(max = 2147483647)
    @Column(name = "efa_observacion")
    private String efaObservacion;
    @JoinColumn(name = "eat_id", referencedColumnName = "eat_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private EmeAtencion emeAtencion;
    @JoinColumn(name = "cfr_id", referencedColumnName = "cef_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CexFisicoRegional cexFisicoRegional;

    public EmeFisicoAtencion() {
    }

    public EmeFisicoAtencion(Integer efaId) {
        this.efaId = efaId;
    }

    public EmeFisicoAtencion(Integer efaId, int efaTipo) {
        this.efaId = efaId;
        this.efaTipo = efaTipo;
    }

    public Integer getEfaId() {
        return efaId;
    }

    public void setEfaId(Integer efaId) {
        this.efaId = efaId;
    }

    public int getEfaTipo() {
        return efaTipo;
    }

    public void setEfaTipo(int efaTipo) {
        this.efaTipo = efaTipo;
    }

    public String getEfaObservacion() {
        return efaObservacion;
    }

    public void setEfaObservacion(String efaObservacion) {
        this.efaObservacion = efaObservacion;
    }

    public EmeAtencion getEmeAtencion() {
        return emeAtencion;
    }

    public void setEmeAtencion(EmeAtencion emeAtencion) {
        this.emeAtencion = emeAtencion;
    }

    public CexFisicoRegional getCexFisicoRegional() {
        return cexFisicoRegional;
    }

    public void setCexFisicoRegional(CexFisicoRegional cexFisicoRegional) {
        this.cexFisicoRegional = cexFisicoRegional;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (efaId != null ? efaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmeFisicoAtencion)) {
            return false;
        }
        EmeFisicoAtencion other = (EmeFisicoAtencion) object;
        if ((this.efaId == null && other.efaId != null) || (this.efaId != null && !this.efaId.equals(other.efaId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.EmeFisicoAtencion[ efaId=" + efaId + " ]";
    }
    
}
